﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace vfife_building_algorithm
{
    public partial class Main_Frame : Form
    {
        //public Model model = null;
        
        public Main_Frame()
        {
            InitializeComponent();
        }
 
        private void newModelNToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form_Modeling f_modeling = new Form_Modeling(this);
            f_modeling.Show();
            
        }
        
        private void editModelToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form_Modeling f_modeling = new Form_Modeling(this);
            f_modeling.Show();
        }
        
        //node force setting
        private void nodeToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            NodeForce_Specify nodeforce_specify = new NodeForce_Specify();
            nodeforce_specify.Show();
        }

        // Element force setting
        private void elementForceToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ElementForce_Specify element_specify=new ElementForce_Specify();
            element_specify.Show();
        }
        
        private void setParametersToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form_ParamSet f_paramset = new Form_ParamSet();
            f_paramset.Show();
        }

        private void runToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Solver.caculate();
            MessageBox.Show("Finish!");
        }

        public void drawModel()
        {
            if (Model.Isset)
            {
                MyOpenGL view = new MyOpenGL();

                view.Dock = DockStyle.Fill;
                view.BringToFront();
                view.Parent = this;
                view.Visible = true;
                this.Controls.Add(view);//The opengl drawing  under a form named Main_Frame  
            }
        }
    }
}
